package com.theme.passport.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.theme.passport.dao.DishMapper;
import com.theme.passport.entity.test.Dish;
import com.theme.passport.entity.test.DishDto;
import com.theme.passport.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;

/**
 * @author: 可乐加糖
 * @create: 2023-02-10 16:01
 * @Description:
 */
//serviceimpl类
@Service
public class DishServiceImpl extends ServiceImpl<DishMapper, Dish> implements DishService {
    @Autowired
    private DishMapper dishMapper;

    @Override
    public Page<DishDto> Page_DishDto(int page, int pageSize) {
        LambdaQueryWrapper<DishDto> wrapper = new LambdaQueryWrapper<>();
        Page<DishDto> page_DishDto = new Page();
        page_DishDto.setCurrent(page);
        page_DishDto.setSize(pageSize);
        dishMapper.selectDishDtoPage(page_DishDto, wrapper);
        return page_DishDto;
    }

}